package com.maiworld.api.controller;

import java.util.Map;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.maiworld.seller.service.ReleaseNawsService;
import com.maiworld.seller.service.ReservationService;

@RestController
@RequestMapping("/reser")
public class ReservationController {

	@Reference
	private ReservationService reservationService;
	
	@Reference
	private ReleaseNawsService releaseNawsService;
	//获取教练信息         (测试通过)
	@RequestMapping("/findCoachId")
	public Map<String,Object> findCoachId(Long sid,String status, String openid,String checkStatus,String session_key){
		return reservationService.findCoach(sid,status,checkStatus);
	}
	//预约但未付款     (测试通过)
	@RequestMapping("/findReserId")
	public Map<String, Object> findReserId(Long sid, String status,String checkStatus,Long cid,String openid,String session_key){
		return reservationService.findReserId(sid, status, checkStatus, cid);
		
	}
	
	//用户预约课下订单(测试通过)
	@RequestMapping(value="/order",method=RequestMethod.POST)
	public Map<String, Object> addRels(
			@RequestBody Map<String,String> params
			){
		System.out.print(params);
		return reservationService.addRels(params);
			
	}

}
